<?php
/**
 * Class Same
 * Desc  不常用控制器
 * Create on 2021/8/3 14:58
 * Create by wangyafang
 */

namespace app\api\controller\xyb;



class AgentArticle extends Base
{
// 无需登录的接口,*表示全部
    protected $noNeedLogin = ['*'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    private $model;

    public function _initialize(){
        $this->model = new \app\api\model\xyb\AgentArticle();
        parent::_initialize();
    }

    /**
     * desc:详情
     */
    public function detail()
    {
        if(!$this->request->isPost()) {
            $this->error('请求类型错误');
        }

        $id = $this->request->param('id');
        $data = $this->model->where('id',$id)->field('name as title,createtime,content')->find();
        $this->success('请求成功',$data);
    }






}